<%@ page contentType="text/html; charset=UTF-8"  %>

<!DOCTYPE html>
<html>
<head>
<title>定时任务</title>
    <%@ include file="/common/meta.jsp" %>
	<%@ include file="/common/import.jsp" %>
	<script type="text/javascript" src="${ctx}/js/zbxtools.js"></script>
	<script type="text/javascript" src="${ctx}/js/easyui/extendvalidate.js"></script>
<script type="text/javascript">
	var inputForm = '#inputForm';
	$(function(){
		$(inputForm).form({
		    success:function(data){
		    	var result = jQuery.parseJSON(data);
		    	if(result.flag=='T'){
		    		$.messager.confirm('提交结果', '操作成功', function(){
						parent.colseAdd();// 关闭添加窗口
		    			parent.cateReload();// 刷新列表
					});
		    	}else if(result.flag=='F'){
		    		$.messager.alert('提交结果', result.msg, 'info');
		    	}else{
		    		$.messager.alert('提交结果', '操作失败', 'error');
		    	}        
		    },
		    error:function(messg)  { 
	       	    $.messager.alert('错误提示', messg.responseText, 'error');
	       }  
		});
		$('#beanId').focus();
	});
	
	function doSubmit(){
		var flag = $(inputForm).form('validate');
		if(flag){
			//ZBXTools.showProcess('正在提交数据...');
			$(inputForm).submit();
		}
	}
</script>
</head>
<body>	
<div id="tip"> </div>
		<form id="inputForm" name="inputForm" method="post" action="${ctx}/task/save.action">
			<input type="hidden" name="formToken" id="formToken" value="${formToken}"/>
			<input type="hidden" name="taskKey" id="taskKey" value="${item.taskKey}"/>
			<table class="datagrid-body" >
			<tr>
				<td class="datagrid-header">任务名称</td>
				<td>
					<input id="className" name="className" value="${item.className}"
					class="easyui-validatebox"  size="40"
					missingMessage="请输入作务名称"  />
				</td>
			</tr>
			<tr >
				<td class="datagrid-header">方法标识<font color=red>*</font></td>
				<td>
					<input name="methodName" id="methodName" value="${item.methodName}"
					class="easyui-validatebox" data-options="required:true,validType:'english'" size="40"
					missingMessage="请输入方法标识" invalidMessage="" />				
				</td>
			</tr>
			<tr >
				<td class="datagrid-header">任务类型<font color=red>*</font></td>
				<td>
				    <select name="taskType" id="taskType">
					   <option value="">--请选择--</option>
					   <option value="">自定义类</option>
					   <option value="spring">接口继承</option>
					   <option value="remote">远程调用</option>
					</select>
				</td>
			</tr>
			
			<tr>
				<td class="datagrid-header">间隔时间</td>
				<td>
					小时:<input title="0~23" id="hour" name="hour"  value="${item.hour}" 
					data-options="required:true,validType:'number'" size="10" />
					分钟:<input title="0~59" id="minute" name="minute"  value="${item.minute}"
					 data-options="required:true,validType:'number'" size="10" />
					秒<input title="0~59" id="second" name="second"  value="${item.second}"
					data-options="required:true,validType:'number'" size="10" />
				</td>
			</tr>	
			<tr>
				<td class="datagrid-header">间隔类型<font color=red>*</font></td>
				<td>
					<select name="intervalType" id="intervalType">
					   <option value="">--请选择--</option>
					   <option value="0">时间</option>
					   <option value="1">每天</option>
					</select>			
					<span style="font-size: 9%; color: red;">如果选择按每天定时执行,小时项未填写则默认此项为1</span>
				</td>
			</tr>
			<tr>
				<td class="datagrid-header">开启类型<font color=red>*</font></td>
				<td>
					<select name="taskStatus" id="taskStatus">
					   <option value="">--请选择--</option>
					   <option value="0">手动开启</option>
					   <option value="1">自动开启</option>
					</select>			
					<span style="font-size: 9%; color: red;">自动开启将在系统启动时自行启动</span>
				</td>
			</tr>
			<tr>
				<td class="datagrid-header">启止时点</td>
				<td>
					开始:<input title="0~23" id="startTime" name="startTime"  value="${item.startTime}" 
					data-options="required:true,validType:'number'" size="10" />
					结束:<input title="0~23" id="endTime" name="endTime"  value="${item.endTime}"
					 data-options="required:true,validType:'number'" size="10" />
				</td>
			</tr>	
			<tr >
				<td class="datagrid-header">描&nbsp;&nbsp;&nbsp;&nbsp;述<font color=red>*</font></td>
				<td>
					<input name="description" id="description" value="${item.description}"
					class="easyui-validatebox" data-options="required:false" size="40"/>				
				</td>
			</tr>		
			<tr>
				<td class="datagrid-header"></td>
				<td >&nbsp;</td>
			</tr>					
			<tr>
				<td class="datagrid-header"></td>
				<td >	
					<a href="#" class="easyui-linkbutton" id="bt1" iconCls="icon-save" onclick="doSubmit();">提交</a>
					<a href="#" class="easyui-linkbutton" iconCls="icon-cancel" onclick="parent.colseAdd();"; >取消</a>	
				</td>
			</tr>
			</table>
		</form>


</body>
</html>


<script>
	ZBXTools.initSelect("taskType","${item.taskType}");
	ZBXTools.initSelect("intervalType","${item.intervalType}");
	ZBXTools.initSelect("taskStatus","${item.taskStatus}");
</script>